<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

</body>
<script>
  var zhang = {
    name: "张三",
    age: 18,
    sex: "男",
    hobby: "唱歌",
  }
  console.log(zhang);

  //  Object.getOwnPropertyDescriptors(zhang); // 传入一个对象 返回对象属性的描述
  // value            属性对应的值
  // writable         属性是否可改写
  // enumerable       属性是否可以枚举(遍历)
  // configurable     属性是否可删除

  var des = Object.getOwnPropertyDescriptors(zhang); // 传入一个对象 返回对象属性的描述
  console.log(des);

  // delete  删除对象的某个属性(允许删除的情况下)
  delete zhang.hobby;
  delete zhang.sex;

  console.log(zhang);

</script>

</html>